var that = this, pics = this.data.pics;
console.log("sasasa"+pics);
if (pics.length < 9) {
    wx.chooseImage({
        count: 9, // 最多可以选择的图片张数，默认9
        sizeType: ['original', 'compressed'], // original 原图，compressed 压缩图，默认二者都有
        sourceType: ['album', 'camera'], // album 从相册选图，camera 使用相机，默认二者都有
        success: function (res) {
            // 返回选定照片的本地文件路径列表，tempFilePath可以作为img标签的src属性显示图片
            var tempFilePaths = res.tempFilePaths;
            // wx.showToast({
            //   title: '正在上传...',
            //   icon: 'loading',
            //   mask: true,
            //   duration: 10000
            // });chooseImg
            wx.uploadFile({
                filePath: tempFilePaths,
                name: 'file',
                url: 'http://loan.bangnila.com/open/api',
                success:function(res){
                    console.log(res)
                }
            })
            if(pics.length +tempFilePaths.length<=9){
                for (var i = 0; i < tempFilePaths.length;i++){
                    pics.push(tempFilePaths[i]);
                }
                console.log(pics);
                that.setData({
                    pics: pics
                })
            }else{
                wx.showToast({
                    title: '最多上传9张图片',
                    icon: 'none',
                    duration: 3000
                });
            }
        },
    });
} else {
    wx.showToast({
        title: '最多上传9张图片',
        icon: 'none',
        duration: 3000
    });
}